# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Mathieu Clabaut <mathieu.clabaut@gmail.com>
# Contributor: Artyom Smirnov <smirnoffjr@gmail.com>
# Contributor: Alexis Robert <alexis.robert@gmail.com>
# Contributor: Daniel Nagy <danielnagy@gmx.de>

pkgname=libantlr3c
pkgver=3.5.3
pkgrel=1
pkgdesc='ANother Tool for Language Recognition'
url='https://www.antlr3.org'
arch=(loong64 x86_64)
license=(BSD)
makedepends=(git)
source=("git+https://github.com/antlr/antlr3.git#tag=$pkgver")
md5sums=('SKIP')

prepare() {
  cd antlr3/runtime/C
  cat <<EOF> antlr3config.h.in
#include <stdint.h>
#include <stdarg.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <antlr3defs.h>
EOF
  aclocal
  libtoolize
  automake --add-missing
  autoconf
}

build() {
  cd antlr3/runtime/C

  ./configure --prefix=/usr --enable-64bit --sysconfdir=/etc
  make
}

package() {
  cd antlr3/runtime/C

  DESTDIR="$pkgdir" make install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

# getver: antlr3.org
# vim: ts=2 sw=2 et:
